package server_stub

import (
	"fmt"
	"m12rpc/http_rpc/server_rpc/server"
	"net/http"
	"net/rpc"
)

func NewServerStub(addr string, n http.Handler) {
	arith := new(server.Arith)
	rpc.Register(arith)
	rpc.HandleHTTP()
	err := http.ListenAndServe(addr, n)
	if err != nil {
		fmt.Println(err.Error())
	}
}
